import request from "@folder-outside-request/request";

export function loginByUsername(data) {
  return request({
    url: "/auth",
    method: "post",
    data
  });
}

export function getUserInfo() {
  return request({
    url: "/user-details",
    method: "get"
  });
}

export function logout(token) {
  return request({
    url: '/logout',
    method: 'post'
  })
}
/**
 * 按钮权限
 * @param data
 */
export function setElements(data) {
  const menuId = data.menuId
  return request({
    url: '/permission/hasPermission',
    method: 'get',
    params: { menuId }
  })
}
